package com.study.services;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.study.model.jdao.IPayrecordDAO;
import com.study.model.mdao.PayrecordMapper;
import com.study.model.pojo.Payrecord;

@Service
@Transactional(rollbackOn = Exception.class)
public class PayRecordService {

	@Autowired
	IPayrecordDAO dao;
	@Autowired
	PayrecordMapper mapper;
	
	/**
	 * 添加付款记录
	 * @param payrecord
	 */
	public void insert(Payrecord payrecord) {
		dao.save(payrecord);
	}
	
	/**
	 * 根据计划id查询记录
	 * @param payid
	 * @return
	 */
	public JSONObject queryId(Integer payid) {
		return mapper.queryById(payid);
	}
}
